package com.buba.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.buba.pojo.LgUser;
import com.buba.mapper.LgUserMapper;
import com.buba.service.LgUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author MrJia
 * @since 2020-10-27
 */
@Service
public class LgUserServiceImpl extends ServiceImpl<LgUserMapper, LgUser> implements LgUserService {

    @Autowired
    private LgUserMapper lgUserMapper;

    @Override
    public LgUser selectOne(String telephone) {
        QueryWrapper<LgUser> lgUserQueryWrapper = new QueryWrapper<>();
        return lgUserMapper.selectOne(lgUserQueryWrapper.lambda().eq(LgUser::getTelephone, telephone));
    }

    @Override
    public List<LgUser> selectListByDeptId(LgUser lgUser) {
        List<LgUser> lgUsers = lgUserMapper.selectListByDeptId(lgUser);
        return lgUsers;
    }

}
